|
RAIS
3.2
|
00001 00028 using System; 00029 using System.Data; 00030 using System.Configuration; 00031 using System.Collections; 00032 using System.Collections.Generic; 00033 using System.Web; 00034 using System.Web.Security; 00035 using System.Web.UI; 00036 using System.Web.UI.WebControls; 00037 using System.Web.UI.WebControls.WebParts; 00038 using System.Web.UI.HtmlControls; 00039 00040 using RAIS.Common.DynamicMaskManagement; 00041 using RAIS.Common.TableManagement; 00042 using RAIS.UI.Common; 00043 using RAIS.Common.UserManagement; 00044 00045 namespace RAIS.UI.SpecificMasks.Dynamic_Masks 00046 { 00047 public partial class ListWithFilter : System.Web.UI.Page 00048 { 00049 //********************************************************************* 00050 #region Fields 00051 00054 DynamicMaskData dynamicMaskData; 00055 #endregion 00056 //********************************************************************* 00057 #region Properties 00058 00061 protected int MaskID 00062 { 00063 get 00064 { 00065 return (Request[Constants.MASK_ID_PARAMETER_NAME] == null) 00066 ? 0 00067 : int.Parse(Request[Constants.MASK_ID_PARAMETER_NAME]); 00068 } 00069 } 00073 protected int TabID 00074 { 00075 get 00076 { 00077 return 0; 00078 } 00079 } 00083 protected DynamicMaskManagement.FormMode CurrentFormMode 00084 { 00085 get 00086 { 00087 return (DynamicMaskManagement.FormMode)(ViewState[Constants.CURRENT_FORM_MODE_TAG]); 00088 } 00089 set 00090 { 00091 ViewState.Add(Constants.CURRENT_FORM_MODE_TAG, value); 00092 } 00093 } 00097 protected UserData CurrentUser 00098 { 00099 get { return (UserData)this.Session[UI.Common.Constants.CURRENT_USER_TAG]; } 00100 } 00104 protected Facility SelectedFacility 00105 { 00106 get { return (Facility)this.Session[UI.Common.Constants.SELECTED_FACILITY_TAG]; } 00107 set { this.Session[UI.Common.Constants.SELECTED_FACILITY_TAG] = value; } 00108 } 00112 protected Department SelectedDepartment 00113 { 00114 get { return (Department)this.Session[UI.Common.Constants.SELECTED_DEPARTMENT_TAG]; } 00115 set { this.Session[UI.Common.Constants.SELECTED_DEPARTMENT_TAG] = value; } 00116 } 00120 protected int SortColumnNumber 00121 { 00122 get 00123 { 00124 return (int)(ViewState[Constants.SORT_COLUMN_NUMBER_TAG]); 00125 } 00126 set 00127 { 00128 ViewState.Add(Constants.SORT_COLUMN_NUMBER_TAG, value); 00129 } 00130 } 00134 protected string SortDirection 00135 { 00136 get 00137 { 00138 return (string)(ViewState[Constants.SORT_DIRECTION_TAG]); 00139 } 00140 set 00141 { 00142 ViewState.Add(Constants.SORT_DIRECTION_TAG, value); 00143 } 00144 } 00148 protected int SavedMaskID 00149 { 00150 get 00151 { 00152 if (this.Session[UI.Common.Constants.SAVED_MASK_ID_TAG] == null) 00153 return 0; 00154 else 00155 return (int)this.Session[UI.Common.Constants.SAVED_MASK_ID_TAG]; 00156 } 00157 set { this.Session[UI.Common.Constants.SAVED_MASK_ID_TAG] = value; } 00158 } 00162 protected int SelectedValue 00163 { 00164 get 00165 { 00166 if (this.Session[UI.Common.Constants.SELECTED_VALUE_TAG] == null) 00167 return 0; 00168 else 00169 return (int)this.Session[UI.Common.Constants.SELECTED_VALUE_TAG]; 00170 } 00171 set { this.Session[UI.Common.Constants.SELECTED_VALUE_TAG] = value; } 00172 } 00176 protected Dictionary<int, int> FiltersValues 00177 { 00178 get 00179 { 00180 if (this.Session[UI.Common.Constants.FILTERS_VALUES_TAG] == null) 00181 return null; 00182 else 00183 return (Dictionary<int, int>)this.Session[UI.Common.Constants.FILTERS_VALUES_TAG]; 00184 } 00185 set { this.Session[UI.Common.Constants.FILTERS_VALUES_TAG] = value; } 00186 } 00187 #endregion 00188 //********************************************************************* 00189 #region Event handlers 00190 protected void Page_PreLoad(object sender, EventArgs e) 00191 { 00192 RAIS.UI.Common.PageManagement.TrimTextBoxValues(this); 00193 } 00200 protected void Page_Load(object sender, EventArgs e) 00201 { 00202 HFrowIndex.Value = ""; 00203 this.Response.Cache.SetNoStore(); 00204 if (this.CurrentUser == null) 00205 UI.Common.AccessManagement.SignOut(this); 00206 00207 this.BTNdelete.Attributes.Add("onclick", string.Format("javascript: return confirm('{0}');", RAIS.Common.Messages.DELETE_QUESTION.Replace("'", "\\'"))); 00208 this.LBLresult.Text = string.Empty; 00209 00210 if (!IsPostBack) 00211 this.CurrentFormMode = DynamicMaskManagement.FormMode.Query; 00212 00213 this.dynamicMaskData = DynamicMaskManagement.GetDynamicMaskData( 00214 this.MaskID, this.TabID, 0, this.CurrentUser, false); 00215 UI.Common.DynamicMaskManagement.SetPreselectedFilter(this.dynamicMaskData, this.SelectedFacility, this.SelectedDepartment); 00216 UI.Common.DynamicMaskManagement.SetPreselectedFilterText(this.dynamicMaskData, this.LBLselectedFacilityNameNoTranslation, this.LBLselectedDepartmentNameNoTranslation); 00217 00218 UI.Common.DynamicMaskManagement.AddFilterControls(this.TBLfilters, this.dynamicMaskData, this.DDL_SelectedIndexChanged); 00219 00220 if (!IsPostBack) 00221 { 00222 this.LBLusernameNoTranslation.Text = this.CurrentUser.Name; 00223 this.LBLtitle.Text = this.dynamicMaskData.DynamicMask.Name; 00224 this.SetControlsProperties(); 00225 00226 this.SortColumnNumber = this.dynamicMaskData.SortColumnNumber; 00227 this.SortDirection = this.dynamicMaskData.SortDirection; 00228 00229 UI.Common.PageManagement.InitializePage(this, this.TreeView1); 00230 // this.LBTNmessagebox.Visible = !(this.CurrentUser.FunctionalRole.Type == FunctionRole.FunctionRoleType.Guest); 00231 } 00232 else 00233 { 00234 this.dynamicMaskData.SortColumnNumber = this.SortColumnNumber; 00235 this.dynamicMaskData.SortDirection = this.SortDirection; 00236 } 00237 00238 UI.Common.PageManagement.InitHelpMainMenu(LBTNdefault, dynamicMaskData.DynamicMask.ID); 00239 } 00246 protected void DDL_SelectedIndexChanged(object sender, EventArgs e) 00247 { 00248 this.CurrentFormMode = DynamicMaskManagement.FormMode.Query; 00249 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00250 UI.Common.DynamicMaskManagement.GetChildFiltersLookupValues(this.dynamicMaskData); 00251 UI.Common.DynamicMaskManagement.InitializeChildFilterControls(this.TBLfilters, this.dynamicMaskData, sender); 00252 00253 if (dynamicMaskData.DynamicMask.IsDepartmentMask) 00254 { 00255 foreach (KeyValuePair<int, DynamicMaskFilterData> kvp in this.dynamicMaskData.FiltersData) 00256 { 00257 DynamicMaskFilterData filterData = kvp.Value; 00258 if (filterData.DynamicMaskFilter.Name == RAIS.Common.Constants.FACILITY_PARAMETER_NAME) 00259 { 00260 this.SelectedFacility = UI.Common.UserManagement.GetFacilityByID(filterData.CurrentLookupValue); 00261 this.SelectedDepartment = null; 00262 UI.Common.DynamicMaskManagement.SetPreselectedFilter(this.dynamicMaskData, this.SelectedFacility, this.SelectedDepartment); 00263 UI.Common.DynamicMaskManagement.SetPreselectedFilterText(this.dynamicMaskData, this.LBLselectedFacilityNameNoTranslation, this.LBLselectedDepartmentNameNoTranslation); 00264 break; 00265 } 00266 } 00267 } 00268 this.SetControlsProperties(); 00269 UI.Common.Localisation.TranslatePage(this); 00270 } 00277 protected void BTNview_Click(object sender, EventArgs e) 00278 { 00279 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00280 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00281 int rowIndex = Convert.ToInt32(this.GVlist.SelectedIndex); 00282 int rowId = dynamicMaskData.GetPKValueByRowIndex(rowIndex); 00283 00284 Response.Redirect( 00285 UI.Common.DynamicMaskManagement.GetDynamicMaskReference(this.dynamicMaskData, this.MaskID, this.TabID + 1, rowId, rowId, false)); 00286 } 00293 protected void BTNadd_Click(object sender, EventArgs e) 00294 { 00295 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00296 this.SaveFiltersValuesToSession(); 00297 00298 00299 Response.Redirect( 00300 UI.Common.DynamicMaskManagement.GetDynamicMaskReference(this.dynamicMaskData, this.MaskID, this.TabID + 1, 0, 0, true)); 00301 } 00308 protected void BTNdelete_Click(object sender, EventArgs e) 00309 { 00310 string actionMessage = ""; 00311 bool success; 00312 00313 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00314 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00315 00316 int rowIndex = Convert.ToInt32(this.GVlist.SelectedIndex); 00317 00318 string rowId = dynamicMaskData.DataSet.Tables[0].Rows[rowIndex][0].ToString(); 00319 00320 int row = dynamicMaskData.GetPKValueByRowIndex(rowIndex); 00321 00322 DynamicMaskData dMD = DynamicMaskManagement.GetDynamicMaskData( 00323 this.MaskID, this.TabID + 1, row, this.CurrentUser, false); 00324 00325 dMD.CurrentRowValues = UI.Common.DynamicMaskManagement.GetCurrentRowFieldsValues(dMD, row, row); 00326 00327 if (dynamicMaskData.NeedsValidation) 00328 { 00329 success = UI.Common.DynamicMaskManagement.SaveChanges(dMD 00330 , RAIS.Common.MessageManagement.Message.ModificationType.Delete 00331 , RAIS.Common.MessageManagement.Message.ModificationType.Edit 00332 , ref actionMessage); 00333 } 00334 else 00335 { 00336 success = UI.Common.DynamicMaskManagement.DeleteRecord(dMD, ref actionMessage); 00337 } 00338 RAIS.UI.Common.MessageDisplay.DisplayReturnMessage(this.LBLresult, 00339 actionMessage, 00340 success); 00341 00342 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00343 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00344 UI.Common.DynamicMaskManagement.InitializeListItems(this.GVlist, this.dynamicMaskData); 00345 00346 if (this.dynamicMaskData.DataSet.Tables[0].Rows.Count == 0) 00347 { 00348 this.CurrentFormMode = DynamicMaskManagement.FormMode.Query; 00349 } 00350 else 00351 { 00352 this.CurrentFormMode = DynamicMaskManagement.FormMode.View; 00353 } 00354 this.SetControlsProperties(); 00355 00356 if (dynamicMaskData.DynamicMask.IsFacilityMask) 00357 { 00358 ClearPreselectedFacility(); 00359 } 00360 else if (dynamicMaskData.DynamicMask.IsDepartmentMask) 00361 { 00362 ClearPreselectedDepartment(); 00363 } 00364 this.GVlist.SelectedIndex = -1; 00365 UI.Common.Localisation.TranslatePage(this); 00366 } 00373 protected void BTNquery_Click(object sender, EventArgs e) 00374 { 00375 this.ExecuteQuery(); 00376 UI.Common.Localisation.TranslatePage(this); 00377 } 00384 protected void GVlist_RowCommand(object sender, GridViewCommandEventArgs e) 00385 { 00386 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00387 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00388 00389 if (e.CommandName.Equals("Select")) 00390 { 00391 int rowIndex = Convert.ToInt32(e.CommandArgument); 00392 HFrowIndex.Value = rowIndex.ToString(); 00393 //int rowId = (int)dynamicMaskData.DataSet.Tables[0].Rows[rowIndex][0]; 00394 int rowId = dynamicMaskData.GetPKValueByRowIndex(rowIndex); 00395 this.SavedMaskID = this.MaskID; 00396 this.SelectedValue = rowId; 00397 this.GVlist.SelectedIndex = rowIndex; 00398 00399 // Set protector for selected row 00400 this.SetProtector(rowId); 00401 00402 if (dynamicMaskData.DynamicMask.IsFacilityMask) 00403 { 00404 this.SelectedFacility = UI.Common.UserManagement.GetFacilityByID(rowId); 00405 this.SelectedDepartment = null; 00406 UI.Common.DynamicMaskManagement.SetPreselectedFilter(this.dynamicMaskData, this.SelectedFacility, this.SelectedDepartment); 00407 UI.Common.DynamicMaskManagement.SetPreselectedFilterText(this.dynamicMaskData, this.LBLselectedFacilityNameNoTranslation, this.LBLselectedDepartmentNameNoTranslation); 00408 //this.SetControlsProperties(); 00409 } 00410 else if (dynamicMaskData.DynamicMask.IsDepartmentMask) 00411 { 00412 this.SelectedDepartment = UI.Common.UserManagement.GetDepartmentByID(rowId); 00413 UI.Common.DynamicMaskManagement.SetPreselectedFilter(this.dynamicMaskData, this.SelectedFacility, this.SelectedDepartment); 00414 UI.Common.DynamicMaskManagement.SetPreselectedFilterText(this.dynamicMaskData, this.LBLselectedFacilityNameNoTranslation, this.LBLselectedDepartmentNameNoTranslation); 00415 //this.SetControlsProperties(); 00416 } 00417 //AutoGenerateSelectButton="True" 00418 this.SetControlsProperties(); 00419 } 00420 00421 if (e.CommandName.Equals("View")) 00422 { 00423 int rowIndex = Convert.ToInt32(e.CommandArgument); 00424 int rowId = (int)dynamicMaskData.DataSet.Tables[0].Rows[rowIndex][0]; 00425 00426 Response.Redirect( 00427 UI.Common.DynamicMaskManagement.GetDynamicMaskReference(this.dynamicMaskData, this.MaskID, this.TabID + 1, rowId, rowId, false)); 00428 } 00429 UI.Common.Localisation.TranslatePage(this); 00430 } 00431 00432 protected void GVlist_Sorting(object sender, GridViewSortEventArgs e) 00433 { 00434 int columnIndex = this.dynamicMaskData.DataSet.Tables[0].Columns.IndexOf(e.SortExpression); 00435 this.dynamicMaskData.SortColumnNumber = columnIndex + 1; 00436 this.dynamicMaskData.SortDirection = 00437 (this.dynamicMaskData.SortColumnNumber == this.SortColumnNumber) 00438 ? ((this.SortDirection == RAIS.Common.Constants.SORT_ORDER_DESCENDING) 00439 ? RAIS.Common.Constants.SORT_ORDER_ASCENDING 00440 : RAIS.Common.Constants.SORT_ORDER_DESCENDING) 00441 : RAIS.Common.Constants.SORT_ORDER_ASCENDING; 00442 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00443 UI.Common.DynamicMaskManagement.InitializeListItems(this.GVlist, this.dynamicMaskData); 00444 00445 this.SortColumnNumber = this.dynamicMaskData.SortColumnNumber; 00446 this.SortDirection = this.dynamicMaskData.SortDirection; 00447 UI.Common.Localisation.TranslatePage(this); 00448 } 00455 protected void GVlist_RowDeleting(object sender, GridViewDeleteEventArgs e) 00456 { 00457 string actionMessage = ""; 00458 bool success; 00459 00460 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00461 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00462 00463 int rowIndex = Convert.ToInt32(e.RowIndex); 00464 00465 string rowId = dynamicMaskData.DataSet.Tables[0].Rows[rowIndex][0].ToString(); 00466 00467 success = UI.Common.DynamicMaskManagement.DeleteRecordFromList(this.dynamicMaskData, rowId, ref actionMessage); 00468 RAIS.UI.Common.MessageDisplay.DisplayReturnMessage(this.LBLresult, 00469 actionMessage, 00470 success); 00471 00472 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00473 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00474 UI.Common.DynamicMaskManagement.InitializeListItems(this.GVlist, this.dynamicMaskData); 00475 00476 if (this.dynamicMaskData.DataSet.Tables[0].Rows.Count == 0) 00477 { 00478 this.CurrentFormMode = DynamicMaskManagement.FormMode.Query; 00479 } 00480 else 00481 { 00482 this.CurrentFormMode = DynamicMaskManagement.FormMode.View; 00483 } 00484 this.SetControlsProperties(); 00485 UI.Common.Localisation.TranslatePage(this); 00486 } 00487 00488 protected void GVlist_PageIndexChanging(object sender, GridViewPageEventArgs e) 00489 { 00490 this.ExecuteQuery(); 00491 00492 // Set new page index 00493 this.GVlist.PageIndex = e.NewPageIndex; 00494 00495 // Bind data to the GridView 00496 this.GVlist.DataBind(); 00497 UI.Common.Localisation.TranslatePage(this); 00498 } 00499 00500 protected void LBclearfacility_Click(object sender, EventArgs e) 00501 { 00502 ClearPreselectedFacility(); 00503 } 00504 00505 protected void LBcleardepartment_Click(object sender, EventArgs e) 00506 { 00507 ClearPreselectedDepartment(); 00508 } 00515 protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e) 00516 { 00517 UI.Common.UserManagement.ProcessTreeViewOnRedirect(this.TreeView1); 00518 } 00525 protected void LBTNlogout_Click(object sender, EventArgs e) 00526 { 00527 UI.Common.AccessManagement.SignOut(this); 00528 } 00529 #endregion 00530 //********************************************************************* 00531 #region Private methods 00532 00535 void SetControlsProperties() 00536 { 00537 UserManagement.AccessRight accessRight = 00538 UI.Common.DynamicMaskManagement.GetPageAccessRights(this, this.dynamicMaskData, this.MaskID); 00539 if (accessRight != null) 00540 { 00541 BTNadd.Visible = accessRight.Add; 00542 BTNdelete.Visible = accessRight.Delete; 00543 } 00544 00545 LBLselectedFacility.Visible = this.dynamicMaskData.IsMultipaged; 00546 LBLselectedFacilityNameNoTranslation.Visible = this.dynamicMaskData.IsMultipaged; 00547 LBclearfacility.Visible = this.dynamicMaskData.IsMultipaged && this.SelectedFacility != null; 00548 LBLselectedDepartment.Visible = this.dynamicMaskData.IsMultipaged; 00549 LBLselectedDepartmentNameNoTranslation.Visible = this.dynamicMaskData.IsMultipaged; 00550 LBcleardepartment.Visible = this.dynamicMaskData.IsMultipaged && this.SelectedDepartment != null; 00551 00552 switch (this.CurrentFormMode) 00553 { 00554 case DynamicMaskManagement.FormMode.View: 00555 this.BTNview.Enabled = (this.GVlist.SelectedIndex != -1); 00556 this.BTNdelete.Enabled = (this.GVlist.SelectedIndex != -1); 00557 this.GVlist.Enabled = true; 00558 00559 break; 00560 00561 case DynamicMaskManagement.FormMode.Query: 00562 this.BTNview.Enabled = false; 00563 this.BTNdelete.Enabled = false; 00564 this.GVlist.Enabled = false; 00565 00566 break; 00567 } 00568 00569 switch ((string)this.Session[UI.Common.Constants.SELECTED_CATEGORY_TAG]) 00570 { 00571 case RAIS.Common.Constants.CATEGORY_NAME_REGULATORY_SYSTEM: 00572 this.LBLregsys.ForeColor = RAIS.UI.Common.Constants.COLOR_OF_MENU_BAR_TEXT_HIGHLIGHT; 00573 break; 00574 case RAIS.Common.Constants.CATEGORY_NAME_INPUT: 00575 this.LBLinput.ForeColor = RAIS.UI.Common.Constants.COLOR_OF_MENU_BAR_TEXT_HIGHLIGHT; 00576 break; 00577 } 00578 } 00579 00580 void ClearPreselectedFacility() 00581 { 00582 this.SelectedFacility = null; 00583 this.SelectedDepartment = null; 00584 UI.Common.DynamicMaskManagement.SetPreselectedFilter(this.dynamicMaskData, this.SelectedFacility, this.SelectedDepartment); 00585 UI.Common.DynamicMaskManagement.SetPreselectedFilterText(this.dynamicMaskData, this.LBLselectedFacilityNameNoTranslation, this.LBLselectedDepartmentNameNoTranslation); 00586 this.SetControlsProperties(); 00587 } 00588 00589 void ClearPreselectedDepartment() 00590 { 00591 this.SelectedDepartment = null; 00592 UI.Common.DynamicMaskManagement.SetPreselectedFilter(this.dynamicMaskData, this.SelectedFacility, this.SelectedDepartment); 00593 UI.Common.DynamicMaskManagement.SetPreselectedFilterText(this.dynamicMaskData, this.LBLselectedFacilityNameNoTranslation, this.LBLselectedDepartmentNameNoTranslation); 00594 this.SetControlsProperties(); 00595 } 00596 00597 void SaveFiltersValuesToSession() 00598 { 00599 Dictionary<int, int> filterValues = null; 00600 Dictionary<string,int> PreselectedRAN=new Dictionary<string,int>(); 00601 00602 foreach (KeyValuePair<int, DynamicMaskFilterData> kvp in this.dynamicMaskData.FiltersData) 00603 { 00604 if (kvp.Value.DynamicMaskFilter.Type == DynamicMaskFilter.FilterType.Lookup) 00605 PreselectedRAN.Add(kvp.Value.DynamicMaskFilter.Name, kvp.Value.CurrentLookupValue); 00606 00607 DynamicMaskFilterData filterData = kvp.Value; 00608 00609 if (filterData.DynamicMaskFilter.Table.ID != 0 00610 && filterData.DynamicMaskFilter.VisibleOnForm 00611 && filterData.CurrentLookupValue != 0) 00612 { 00613 if (filterValues == null) 00614 filterValues = new Dictionary<int, int>(); 00615 00616 if (!filterValues.ContainsKey(filterData.DynamicMaskFilter.Table.ID)) 00617 filterValues.Add(filterData.DynamicMaskFilter.Table.ID, (int)filterData.CurrentLookupValue); 00618 } 00619 } 00620 PreselectedRAN.Add("SelectedFacility", this.dynamicMaskData.SelectedFacilityID); 00621 PreselectedRAN.Add("SelectedDepartment", this.dynamicMaskData.SelectedDepartmentID); 00622 Session["Preselected_RAN"] = PreselectedRAN; 00623 this.FiltersValues = filterValues; 00624 } 00625 00626 void SetProtector(int rowId) 00627 { 00628 //if (this.dynamicMaskData.DynamicMask.Table != null) 00629 //{ 00630 // Get protector for selected row 00631 this.dynamicMaskData.Protector = 00632 ApplicationLogicLayer.DynamicMaskManagement.GetProtector( 00633 this.dynamicMaskData.DynamicMask.Table.Name 00634 , rowId); 00635 //} 00636 //else 00637 // this.dynamicMaskData.Protector = null; 00638 00639 // Defend row with protector 00640 if (dynamicMaskData.Protector != null) 00641 { 00642 this.BTNdelete.Attributes.Add("onclick", string.Format("javascript: alert('{0}'); return false;", dynamicMaskData.Protector.DeleteMessage.Replace("'", "\\'"))); 00643 } 00644 else 00645 { 00646 this.BTNdelete.Attributes.Add("onclick", string.Format("javascript: return confirm('{0}');", RAIS.Common.Messages.DELETE_QUESTION.Replace("'", "\\'"))); 00647 } 00648 } 00649 00650 void ExecuteQuery() 00651 { 00652 UI.Common.DynamicMaskManagement.InitializeFilterObjectsFromFilterControls(this.TBLfilters, this.dynamicMaskData); 00653 UI.Common.DynamicMaskManagement.GetDataSetForListMask(this.dynamicMaskData); 00654 UI.Common.DynamicMaskManagement.InitializeListItems(this.GVlist, this.dynamicMaskData); 00655 if (this.SavedMaskID == this.MaskID) 00656 { 00657 this.GVlist.SelectedIndex = this.dynamicMaskData.GetRowIndexByPKValue(this.SelectedValue); 00658 } 00659 else 00660 { 00661 this.SavedMaskID = this.MaskID; 00662 this.SelectedValue = 0; 00663 } 00664 00665 // Set protector for selected row 00666 if (this.GVlist.SelectedIndex != -1) 00667 { 00668 int rowIndex = Convert.ToInt32(this.GVlist.SelectedIndex); 00669 int rowId = dynamicMaskData.GetPKValueByRowIndex(rowIndex); 00670 00671 this.SetProtector(rowId); 00672 } 00673 00674 // Set current form mode 00675 if (this.dynamicMaskData.DataSet.Tables[0].Rows.Count == 0) 00676 { 00677 this.CurrentFormMode = DynamicMaskManagement.FormMode.Query; 00678 } 00679 else 00680 { 00681 this.CurrentFormMode = DynamicMaskManagement.FormMode.View; 00682 } 00683 this.SetControlsProperties(); 00684 } 00685 #endregion 00686 } 00687 }